SwitchButton = {
    name = "SwitchButton",
    dependencies = {
        Switch
    }
}

local function onSwitchOn(self)
    self.subStyle = "selected"
end

local function onSwitchOff(switch)
    switch.subStyle = "none"
end
function SwitchButton:ctor()
    self:onSwitchOn(onSwitchOn, self)
    self:onSwitchOff(onSwitchOff, self)
end

function Node.SwitchButton(str)
    local btn = Node.Button(str):addComponent(SwitchButton)
    return btn
end
